package com.tucy.logistics.common.enums;

import com.tucy.logistics.common.base.EnumInterface;
import lombok.Getter;

/**
 * author: tcy
 * description:签收类型枚举
 */
@Getter
public enum SignRecipientEnum implements EnumInterface {

    SELF("self",1,"本人"),
    OTHER("other",2,"代收");

    /**
     * 编码
     */
    private final String code;

    /**
     * 值
     */
    private final Integer value;

    /**
     * 键
     */
    private final String key;

    SignRecipientEnum(String code, int value, String key) {
        this.code = code;
        this.value = value;
        this.key = key;
    }

    public static SignRecipientEnum getByValue(Integer value) {

        SignRecipientEnum baseEnum = null;

        for (SignRecipientEnum item : values()) {
            if (item.getValue().equals(value)) {
                baseEnum = item;
                break;
            }
        }
        return baseEnum;
    }

}
